package com.ymatou.iapi.godmch.testcase;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.json.JSONException;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.dguser.parameter.UserCreateBean;
import com.ymatou.iapi.godmch.parameter.CreateCodeBean;
import com.ymatou.iapi.godmch.parameter.MchInfoVo;
import com.ymatou.iapi.godmch.parameter.applyAgentBean;
import com.ymatou.iapi.godmch.parameter.applySupplierBean;
import com.ymatou.iapi.godmch.parameter.approveAgentBean;
import com.ymatou.iapi.godmch.parameter.bindmchBean;
import com.ymatou.iapi.godmch.parameter.createIndepMchBean;
import com.ymatou.iapi.godmch.parameter.createagentBean;
import com.ymatou.iapi.godmch.parameter.createmchBean;
import com.ymatou.iapi.godmch.parameter.detailmchBean;
import com.ymatou.iapi.godmch.parameter.editmchBean;
import com.ymatou.iapi.godmch.parameter.mchInfo;
import com.ymatou.iapi.godmch.parameter.registerByCodeBean;
import com.ymatou.iapi.godmch.parameter.setShareTypeBean;
import com.ymatou.iapi.godmch.service.CreateCodeCall;
import com.ymatou.iapi.godmch.service.applyAgentCall;
import com.ymatou.iapi.godmch.service.approveSupplierCall;
import com.ymatou.iapi.godmch.service.createIndepMchCall;
import com.ymatou.iapi.godmch.service.createagentCall;
import com.ymatou.iapi.godmch.service.detailmchCall;
import com.ymatou.iapi.godmch.service.getAgentPromotePicCall;
import com.ymatou.iapi.godmch.service.registerByCodeCall;
import com.ymatou.iapi.godmch.service.setShareTypeCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.business.service.DGUserCallService;
import com.ymttest.business.service.shenqi.GodmchManageCallService;
import com.ymttest.database.model.agent_type;
import com.ymttest.database.model.country_info;
import com.ymttest.database.model.invite_code;
import com.ymttest.database.model.mch_info;
import com.ymttest.database.model.mch_relation;
import com.ymttest.database.sqlwapper.godmch.DefGodMchWapper;
import com.ymttest.database.sqlwapper.godmch.agent_typeWapper;
import com.ymttest.database.sqlwapper.godmch.country_infoWapper;
import com.ymttest.database.sqlwapper.godmch.invite_codeWapper;
import com.ymttest.database.sqlwapper.godmch.mch_infoWapper;
import com.ymttest.database.sqlwapper.godmch.mch_relationWapper;
import com.ymttest.utils.EnvSetup;
/**
*商户信息
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_detailmch{
	private static detailmchBean detailmchbean;
	private static detailmchCall detailmchcall;
	private  setShareTypeBean shareTypeBbean=new setShareTypeBean();
	private  setShareTypeCall shareTypeCall=new setShareTypeCall();
	DefGodMchWapper DefGodMchWapper;
	mch_infoWapper mchInfoWapper=new mch_infoWapper();
	Integer agent_promote_mchId=Integer.parseInt(EnvSetup.getData("agent_promote_mchId"));
	Integer sale_distribution=Integer.parseInt(EnvSetup.getData("sale_distribution"));
	Integer masterChainShopId_wechatDirectPayMode=Integer.parseInt(EnvSetup.getData("masterChainShopId_wechatDirectPayMode"));
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("商户信息");
	}

	@Before
	public void caseUp() {
		detailmchbean=new detailmchBean();
		detailmchcall=new detailmchCall();
		DefGodMchWapper=new DefGodMchWapper();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(detailmchcall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	/**
	 * 
	 * @param userId_channl 渠道id
	 * @param isVip  是否是vip
	 * @param isCurrency  渠道商为国外货币,代理是否为国内
	 * @param userId_agent  代理用户
	 * @throws InterruptedException
	 * @throws JSONException
	 * @throws ParseException 
	 */
	private void checkVerify(int mchId,boolean... indepMchSelf) throws InterruptedException, JSONException, ParseException
	{
		MchInfoVo rminfo = detailmchcall.getResult();
		mch_info dbmchinfo = DefGodMchWapper.selectMchInfo(mchId).get(0);
		country_info dbCountryInfo = DefGodMchWapper.selectCountryInfo(rminfo.getCountryCode(),null).get(0);
		//用户信息
		Logger.verifyEquals(dbmchinfo.getAgent()==1?true:false, rminfo.getAgent(), "验证Agent");
		Logger.verifyEquals(dbmchinfo.getVip()==1?true:false, rminfo.getVip(), "验证vip");
		Logger.verifyEquals(dbmchinfo.getChannels()==1?true:false, rminfo.getChannel(), "验证getChannels");
		Logger.verifyEquals(dbmchinfo.getVip()==1?true:false, rminfo.getVip(), "验证Vip");
		Logger.verifyEquals(dbmchinfo.getAvatar(), rminfo.getAvatar(), "验证Avatar");
		Logger.verifyEquals(dbmchinfo.getMchTitle()==null||dbmchinfo.getMchTitle().length()==0?dbmchinfo.getNickName():dbmchinfo.getMchTitle(), rminfo.getMchTitle(), "验证MchTitle");
		Logger.verifyEquals(dbmchinfo.getSeqId(), rminfo.getSeqId(), "验证SeqId");
		//国家信息
		Logger.verifyEquals(dbCountryInfo.getCnTitle(), rminfo.getCountry(), "验证Country");
		Logger.verifyEquals(dbCountryInfo.getCountry(), rminfo.getCountryCode(), "验证CountryCode");
		Logger.verifyEquals(dbCountryInfo.getCurrency(), rminfo.getCurrency(), "验证Currency");
		Logger.verifyEquals(dbCountryInfo.getFlag(), rminfo.getFlag(), "验证Flag");
		//查询国家 验证supportLocalCurrency
    	//country_info cinfo=new country_infoWapper().selectByPrimaryKey(dbCountryInfo.getCountry());
		Logger.verifyEquals(dbCountryInfo.getSupportLocalCurrency()==1?true:false, rminfo.getSupportLocalCurrency(), "验证SupportLocalCurrency");
		
		//Status 1：正常 2：下架（独立小程序特有状态，指公共小程序下架，切换时间到过期时间这段时间） 3：打烊（独立小程序特有状态，指独立小程序，过期时间后）
		if(rminfo.getExpiredTime()!=null )
		{
			Date date = new Date();
			if(dbmchinfo.getSwitchIndeMiniAppTime()==null && rminfo.getParentMchId()!=null)
			{
				mch_info infos=DefGodMchWapper.selectMchInfo(Integer.parseInt(rminfo.getParentMchId())).get(0);
				date=infos.getSwitchIndeMiniAppTime();
			}
			else {
				 date = dbmchinfo.getSwitchIndeMiniAppTime();//取时间 
			}
			SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd") ;
		    Calendar calendar  =   Calendar.getInstance();
		    calendar.setTime(date); //需要将date数据转移到Calender对象中操作
		    calendar.add(calendar.DATE, 6);//把日期往后增加n天.正数往后推,负数往前移动 
		    date=calendar.getTime();   //这个时间就是日期往后推一天的结果 
		    Logger.verifyEquals(dateFormat.format(date), rminfo.getExpiredTime(), "验证ExpiredTime,往后延迟多少天过期，是根据dizconfig配置，目前研发配置7天，包括当天");
		}
		else
			Logger.verifyEquals(1, rminfo.getStatus(), "验证Status");
		
		Logger.verifyEquals(dbmchinfo.getPayMode(),rminfo.getPayMode(), "验证PayMode");
		//商户类型 1：平台商户     2：独立商户
		Logger.verifyEquals(dbmchinfo.getMchType(),rminfo.getMchType(), "验证mchType");
		//支付宝支付方式 新增20191224
		Logger.verifyEquals(0,rminfo.getAliPayMode(), "验证AliPayMode");
		Logger.verifyEquals(dbmchinfo.getAliPayMode(),rminfo.getAliPayMode(), "验证AliPayMode");
		//dualMode 双店模式 0：正常模式 1：双店模式
		Logger.verifyEquals(dbmchinfo.getDualMode(),rminfo.getDualMode(), "验证DualMode");
		//买家端客服新增20200317
		//买家端客服是否开启
		Logger.verifyEquals(dbmchinfo.getBuyerCsEnabled(),rminfo.getBuyerCsEnabled(), "验证BuyerCsEnabled");
		//买家端客服微信号
		Logger.verifyEquals(dbmchinfo.getBuyerCsWechat(),rminfo.getBuyerCsWechat(), "验证BuyerCsWechat");
		//payChannel 1：hipoPay 2：盛付通  新增20200324
		Logger.verifyEquals(dbmchinfo.getPayMode()==3?2:1,rminfo.getPayChannel(), "验证PayChannel");
		//是否独立商户主账号 20200326
		Logger.verifyEquals(dbmchinfo.getIndepMchFlg()==1?true:false, rminfo.getIndepMchSelf(), "验证是否独立商户主账号 indepMchSelf");
	    //新增 20200407
		Logger.verifyEquals(dbmchinfo.getSettlementCurrency(),rminfo.getSettlementCurrency(), "验证SettlementCurrency");
		Logger.verifyEquals(dbmchinfo.getPayMode(),rminfo.getPayMode(), "验证PayMode");
		Logger.verifyEquals(dbmchinfo.getDomesticPayMode(),rminfo.getDomesticPayMode(), "验证DomesticPayMode");
		Logger.verifyEquals(dbmchinfo.getPulishDomestic()==0?false:true,rminfo.getPulishDomestic(), "验证PulishDomestic");
		
        //20201020 新增
		Logger.verifyEquals(dbmchinfo.getYabandPayMode(),rminfo.getYabandPayMode(), "验证YabandPayMode");
	    //20201027 新增字段  masterChainShopId连锁店、wechatDirectPayMode微信直连
		Logger.verifyEquals(dbmchinfo.getWechatDirectPayMode(),rminfo.getWechatDirectPayMode(), "验证WechatDirectPayMode");
		Logger.verifyEquals(dbmchinfo.getMasterChainShopId(),rminfo.getMasterChainShopId(), "验证MasterChainShopId");
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_001() {
		Logger.start(true,"商户信息,验证商户id存在,返回正常");
		try {
			String title="title1";
			String wc="wc2";
			CreateCodeBean ccbean = GodmchManageCallService.CreateAllMsgSellerMch();
			String code = GodmchManageCallService.createCodeCall(ccbean).getCode();
			Integer agentid = GodmchManageCallService.CreateSellerMch(code);
			GodmchManageCallService.editMchInfo(ccbean.getMchId(),title, DGUserCallService.DefImg2,wc);
			detailmchbean.setMchId(ccbean.getMchId()); 
			//detailmchbean.setMchId(500093708); 
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			checkVerify(ccbean.getMchId());
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_002() {
		Logger.start(true,"商户信息,验证商户id不存在，返回错误");
		try {
			detailmchbean.setMchId(-1);
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			Logger.verifyIsNull( detailmchcall.getResult(),"验证返回结果");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_003() {
		Logger.start(true,"商户信息,验证商户id为空，返回错误");
		try {
//			detailmchbean.setMchId(-1);
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			Logger.verifyEquals("4001", detailmchcall.getString("status"), "验证status");
			Logger.verifyIsNull( detailmchcall.getResult(),"验证返回结果");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_004() {
		Logger.start(true,"验证代理商户,返回正常");
		try {
			String title="title1";
			String wc="wc2";
			CreateCodeBean ccbean = GodmchManageCallService.CreateAllMsgSellerMch();
			String code = GodmchManageCallService.createCodeCall(ccbean).getCode();
			Integer agentid = GodmchManageCallService.CreateSellerMch(code);
			GodmchManageCallService.editMchInfo(ccbean.getMchId(),title, DGUserCallService.DefImg2,wc);
			detailmchbean.setMchId(agentid);
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			checkVerify(agentid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_005() {
		Logger.start(true,"验证vip商户,返回正常");
		try {
			String title="title1";
			String wc="wc2";
			CreateCodeBean ccbean = GodmchManageCallService.CreateAllMsgSellerMch();
			GodmchManageCallService.SetVip(ccbean.getMchId());
			detailmchbean.setMchId(ccbean.getMchId());
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			checkVerify(ccbean.getMchId());
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_006() {
		Logger.start(true,"验证vip代理商户,返回正常");
		try {
			String title="title1";
			String wc="wc2";
			CreateCodeBean ccbean = GodmchManageCallService.CreateAllMsgSellerMch();
			GodmchManageCallService.SetVip(ccbean.getMchId());
			String code = GodmchManageCallService.createCodeCall(ccbean).getCode();
			Integer agentid = GodmchManageCallService.CreateSellerMch(code);
			GodmchManageCallService.editMchInfo(ccbean.getMchId(),title, DGUserCallService.DefImg2,wc);
			detailmchbean.setMchId(agentid);
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			checkVerify(agentid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_007() {
		Logger.start(true,"验证客服,返回空数据");
		try {
			String title="title1";
			String wc="wc2";
			CreateCodeBean ccbean = GodmchManageCallService.CreateAllMsgSellerMch();
			GodmchManageCallService.SetVip(ccbean.getMchId());
			UserCreateBean usercreateBean = DGUserCallService.initCsUsercreateBean();
			int csId = DGUserCallService.UserCreateCall(usercreateBean);
			GodmchManageCallService.CreateCSCall(ccbean.getMchId(), csId, 4);
			GodmchManageCallService.EditCsRemark(ccbean.getMchId(), csId, "remakr1");
			Logger.comment("创建渠道商客服:" + csId);
			detailmchbean.setMchId(csId);
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			Logger.verifyIsNull( detailmchcall.getResult(),"验证返回结果");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_008() {
		Logger.start(true,"商户信息,验证商户id存在,小程序切换 成独立小程序，mchShareType=1 变为 mchShareType=3 ");
		try {
			String title="title1";
			String wc="wc2";
			CreateCodeBean ccbean = GodmchManageCallService.CreateAllMsgSellerMch();
			String code = GodmchManageCallService.createCodeCall(ccbean).getCode();
			Integer agentid = GodmchManageCallService.CreateSellerMch(code);
			GodmchManageCallService.editMchInfo(ccbean.getMchId(),title, DGUserCallService.DefImg2,wc);
			
			//公共小程序切换 成独立小程序
			shareTypeBbean.setMchId(ccbean.getMchId());
			shareTypeBbean.setMchShareType(3);//独立小程序  分享方式1：小程序 2：H5 3：独立小程序  4：独立h5  5：继承版小程序
			shareTypeBbean.setMchStatus(0);
			shareTypeBbean.setRemark("小程序 变为独立小程序");
			
			//新字段
			shareTypeBbean.setPayMode(1);//支付方式:微信支付通道1：飞界国际2：飞界国际电子商务3：盛付通
			shareTypeBbean.setMchSideBuy(1);//商家端购买1：二维码购买 2：直接购买
			shareTypeBbean.setDualMode(0);//双店模式0：正常模式（默认）1：双店模式
			
			shareTypeCall.setData(shareTypeBbean);
			shareTypeCall.callService();
			
			detailmchbean.setMchId(ccbean.getMchId()); 
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			Logger.verifyNotNull( detailmchcall.getResult().getExpiredTime(), "验证ExpiredTime");
			Logger.verifyEquals(2, detailmchcall.getResult().getStatus(), "验证Status");
			checkVerify(ccbean.getMchId());
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_009() {
		Logger.start(true,"商户信息,验证商户id存在,小程序切换h5，mchShareType=1 变为 mchShareType=2 ");
		try {
			String title="title1";
			String wc="wc2";
			CreateCodeBean ccbean = GodmchManageCallService.CreateAllMsgSellerMch();
			String code = GodmchManageCallService.createCodeCall(ccbean).getCode();
			Integer agentid = GodmchManageCallService.CreateSellerMch(code);
			GodmchManageCallService.editMchInfo(ccbean.getMchId(),title, DGUserCallService.DefImg2,wc);
			
			//公共小程序切换 成独立小程序
			shareTypeBbean.setMchId(ccbean.getMchId());
			shareTypeBbean.setMchShareType(2);//H5
			shareTypeBbean.setMchStatus(0);
			shareTypeBbean.setRemark("小程序 变为独立小程序");
			shareTypeCall.setData(shareTypeBbean);
			shareTypeCall.callService();
			
			detailmchbean.setMchId(ccbean.getMchId()); 
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			Logger.verifyIsNull( detailmchcall.getResult().getExpiredTime(), "验证ExpiredTime");
			
			checkVerify(ccbean.getMchId());
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_010() {
		Logger.start(true,"商户信息,验证商户id存在,商户状态为关闭");
		try {
			String title="title1";
			String wc="wc2";
			CreateCodeBean ccbean = GodmchManageCallService.CreateAllMsgSellerMch();
			String code = GodmchManageCallService.createCodeCall(ccbean).getCode();
			Integer agentid = GodmchManageCallService.CreateSellerMch(code);
			GodmchManageCallService.editMchInfo(ccbean.getMchId(),title, DGUserCallService.DefImg2,wc);
			
			//公共小程序切换 成独立小程序
			shareTypeBbean.setMchId(ccbean.getMchId());
			shareTypeBbean.setMchShareType(2);//H5
			shareTypeBbean.setMchStatus(-1);
			shareTypeBbean.setRemark("小程序 变为 H5");
			shareTypeCall.setData(shareTypeBbean);
			shareTypeCall.callService();
			
			detailmchbean.setMchId(ccbean.getMchId()); 
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			Logger.verifyEquals(true, detailmchcall.getString("msg").contains("请求成功"), "验证msg");
		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_011() {
		Logger.start(true,"商户信息,验证商户id存在,小程序切换 成独立小程序，mchShareType=1 变为 mchShareType=3 ,返回status=3 打烊（独立小程序特有状态，指独立小程序，过期时间后）");
		try {
			String title="title1";
			String wc="wc2";
			CreateCodeBean ccbean = GodmchManageCallService.CreateAllMsgSellerMch();
			String code = GodmchManageCallService.createCodeCall(ccbean).getCode();
			Integer agentid = GodmchManageCallService.CreateSellerMch(code);
			GodmchManageCallService.editMchInfo(ccbean.getMchId(),title, DGUserCallService.DefImg2,wc);
			
			//公共小程序切换 成独立小程序
			shareTypeBbean.setMchId(ccbean.getMchId());
			shareTypeBbean.setMchShareType(3);//独立小程序
			shareTypeBbean.setMchStatus(0);
			shareTypeBbean.setRemark("小程序 变为独立小程序");
			
			//新字段
			shareTypeBbean.setPayMode(1);//支付方式:微信支付通道1：飞界国际2：飞界国际电子商务3：盛付通
			shareTypeBbean.setMchSideBuy(1);//商家端购买1：二维码购买 2：直接购买
			shareTypeBbean.setDualMode(0);//双店模式0：正常模式（默认）1：双店模式
			shareTypeCall.setData(shareTypeBbean);
			shareTypeCall.callService();
			//更改时间
			Date date = new Date();//取时间 
		    Calendar calendar  =   Calendar.getInstance();
		    calendar.setTime(date); //需要将date数据转移到Calender对象中操作
		    calendar.add(calendar.DATE, -6);//把日期往后增加n天.正数往后推,负数往前移动 
		    date=calendar.getTime();   //这个时间就是日期往后推一天的结果 
		    
			mch_info mchinfo=DefGodMchWapper.selectMchInfo(ccbean.getMchId()).get(0);
			mchinfo.setSwitchIndeMiniAppTime(date);
			mchInfoWapper.updateByPrimaryKey(mchinfo);
			
			detailmchbean.setMchId(ccbean.getMchId()); 
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			Logger.verifyNotNull( detailmchcall.getResult().getExpiredTime(), "验证ExpiredTime");
			Logger.verifyEquals(3, detailmchcall.getResult().getStatus(), "验证Status");
			checkVerify(ccbean.getMchId());
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_012() {
		Logger.start(true,"商户信息,验证商户id存在,小程序切换 成独立小程序，mchShareType=1 变为 mchShareType=3 ,但switchIndeMiniAppTime=null,检查历史数据之前已经设置，当时不存在switchIndeMiniAppTime字段");
		try {
			String title="title1";
			String wc="wc2";
			CreateCodeBean ccbean = GodmchManageCallService.CreateAllMsgSellerMch();
			String code = GodmchManageCallService.createCodeCall(ccbean).getCode();
			Integer agentid = GodmchManageCallService.CreateSellerMch(code);
			GodmchManageCallService.editMchInfo(ccbean.getMchId(),title, DGUserCallService.DefImg2,wc);
			
			//公共小程序切换 成独立小程序
			shareTypeBbean.setMchId(ccbean.getMchId());
			shareTypeBbean.setMchShareType(3);//独立小程序
			shareTypeBbean.setMchStatus(0);
			shareTypeBbean.setRemark("小程序 变为独立小程序");
			
			//新字段
			shareTypeBbean.setPayMode(2);//支付方式:微信支付通道1：飞界国际2：飞界国际电子商务3：盛付通
			shareTypeBbean.setMchSideBuy(1);//商家端购买1：二维码购买 2：直接购买
			shareTypeBbean.setDualMode(0);//双店模式0：正常模式（默认）1：双店模式
			
			shareTypeCall.setData(shareTypeBbean);
			shareTypeCall.callService();
		    
			mch_info mchinfo=DefGodMchWapper.selectMchInfo(ccbean.getMchId()).get(0);
			mchinfo.setSwitchIndeMiniAppTime(null);//设置为空
			mchInfoWapper.updateByPrimaryKey(mchinfo);
			
			detailmchbean.setMchId(ccbean.getMchId()); 
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			Logger.verifyIsNull( detailmchcall.getResult().getExpiredTime(), "验证ExpiredTime");
			Logger.verifyEquals(1, detailmchcall.getResult().getStatus(), "验证Status");
			checkVerify(ccbean.getMchId());
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_013() {
		Logger.start(true,"商户信息,验证商户id存在,创建渠道-小程序切换 成独立小程序，mchShareType=1 变为 mchShareType=5,返回上级商户Id parentMchId");
		try {
			String title="title1";
			String wc="wc2";
			CreateCodeBean ccbean = GodmchManageCallService.CreateAllMsgSellerMch();
			String code = GodmchManageCallService.createCodeCall(ccbean).getCode();
			Integer agentid = GodmchManageCallService.CreateSellerMch(code);
			GodmchManageCallService.editMchInfo(ccbean.getMchId(),title, DGUserCallService.DefImg2,wc);
			
			//公共小程序切换 成独立小程序
			shareTypeBbean.setMchId(ccbean.getMchId());
			shareTypeBbean.setMchShareType(5);//小程序（继承版）
			shareTypeBbean.setMchStatus(0);
			shareTypeBbean.setRemark("小程序 变为独立小程序（继承版）");
			//新字段
			shareTypeBbean.setPayMode(2);//支付方式:微信支付通道1：飞界国际2：飞界国际电子商务3：盛付通
			shareTypeBbean.setMchSideBuy(1);//商家端购买1：二维码购买 2：直接购买
			shareTypeBbean.setDualMode(0);//双店模式0：正常模式（默认）1：双店模式
			
			shareTypeCall.setData(shareTypeBbean);
			shareTypeCall.callService();
		    
			mch_info mchinfo=DefGodMchWapper.selectMchInfo(ccbean.getMchId()).get(0);
			mchinfo.setSwitchIndeMiniAppTime(null);//设置为空
			mchInfoWapper.updateByPrimaryKey(mchinfo);
			
			detailmchbean.setMchId(ccbean.getMchId()); 
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			Logger.verifyIsNull( detailmchcall.getResult().getExpiredTime(), "验证ExpiredTime");
			Logger.verifyEquals(1, detailmchcall.getResult().getStatus(), "验证Status");
			checkVerify(ccbean.getMchId());
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	@Ignore
	public void Tc_detailmch_014() {
		//分享类型切换限制，公共版商家的分享类型去掉选项 “独立小程序继承版”，公共版商家不让使用这个选项
		//页面隐藏 “独立小程序继承版”,若出现异常选择了“5：独立小程序继承版”，程序自动不更新，保持原来的分享类型
		Logger.start(true,"商户信息,验证商户id存在,创建代理-小程序切换 成独立小程序，mchShareType=1 变为 mchShareType=5,返回上级商户Id parentMchId,渠道设置5后，下面的子代理都更新为5, 作废");
		try {
			
			//代理用户
			UserCreateBean usercreateBean = DGUserCallService.initSellerUsercreateBean();
			int mchId = DGUserCallService.UserCreateCall(usercreateBean);
			usercreateBean = DGUserCallService.initSellerUsercreateBean();
			int mchId_agent = DGUserCallService.UserCreateCall(usercreateBean);
			
			CreateCodeBean codebean=GodmchManageCallService.CreateAllMsgSellerMch();
			codebean.setIsPermanently(false);
			CreateCodeCall codeCall=GodmchManageCallService.createCodeCall(codebean);
			//创建渠道1
			createmchBean createBean1=GodmchManageCallService.InitcreatemchBeanForChannel(mchId);
			GodmchManageCallService.createmchCallForChannel(createBean1);
			//渠道1 邀请码
			CreateCodeBean createCodeBean=GodmchManageCallService.InitcreateCodeBeanForAgent(mchId, true);
			CreateCodeCall createCodeCall=GodmchManageCallService.createCodeCall(createCodeBean);
			//创建渠道2
		    createBean1=GodmchManageCallService.InitcreatemchBeanForChannel(mchId_agent);
			GodmchManageCallService.createmchCallForChannel(createBean1);
			//绑定一个渠道与另外一个渠道绑定
			bindmchBean bindmchBean=GodmchManageCallService.InitbindmchBean(mchId_agent, createCodeCall.getCode());
			GodmchManageCallService.bindmchcall(bindmchBean);

			String title="title1";
			String wc="wc2";
			CreateCodeBean ccbean = GodmchManageCallService.CreateAllMsgSellerMch();
			String code = GodmchManageCallService.createCodeCall(ccbean).getCode();
			Integer agentid = GodmchManageCallService.CreateSellerMch(code);
			GodmchManageCallService.editMchInfo(ccbean.getMchId(),title, DGUserCallService.DefImg2,wc);
			
			//公共小程序切换 成独立小程序
			shareTypeBbean.setMchId(mchId);
			shareTypeBbean.setMchShareType(5);//小程序（继承版）
			shareTypeBbean.setMchStatus(0);
			shareTypeBbean.setRemark("小程序 变为独立小程序（继承版）");
			//新字段
			shareTypeBbean.setPayMode(2);//支付方式:微信支付通道1：飞界国际2：飞界国际电子商务3：盛付通
			shareTypeBbean.setMchSideBuy(1);//商家端购买1：二维码购买 2：直接购买
			shareTypeBbean.setDualMode(0);//双店模式0：正常模式（默认）1：双店模式
			
			shareTypeCall.setData(shareTypeBbean);
			shareTypeCall.callService();
			Thread.sleep(1000);
			detailmchbean.setMchId(mchId_agent); 
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
//			Logger.verifyIsNull( detailmchcall.getResult().getExpiredTime(), "验证ExpiredTime");
			Logger.verifyEquals(2, detailmchcall.getResult().getStatus(), "验证Status");
			
			checkVerify(mchId_agent);
			
			Logger.verifyEquals(mchId,  Integer.parseInt(detailmchcall.getResult().getParentMchId()), "验证ParentMchId");
			Logger.verifyEquals(shareTypeBbean.getMchShareType(),  detailmchcall.getResult().getmchShareType(), "验证mchShareType");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_015() {
		Logger.start(true,"商户信息,验证商户id存在,创建渠道-小程序切换成 独立小程序（继承版），mchShareType=1 变为 mchShareType=5,返回上级商户Id parentMchId,渠道设置5后，下面的子代理都更新为5");
		try {
			
			String title="title1";
			String wc="wc2";
			CreateCodeBean ccbean = GodmchManageCallService.CreateAllMsgSellerMch();
			String code = GodmchManageCallService.createCodeCall(ccbean).getCode();
			Integer agentid = GodmchManageCallService.CreateSellerMch(code);
			GodmchManageCallService.editMchInfo(ccbean.getMchId(),title, DGUserCallService.DefImg2,wc);
			
			//公共小程序切换成 独立小程序（继承版
			shareTypeBbean.setMchId(ccbean.getMchId());
			shareTypeBbean.setMchShareType(5);//小程序（继承版）
			shareTypeBbean.setMchStatus(0);
			shareTypeBbean.setRemark("小程序 变为独立小程序（继承版）");
			shareTypeCall.setData(shareTypeBbean);
			shareTypeCall.callService();
		    
			mch_info mchinfo=DefGodMchWapper.selectMchInfo(ccbean.getMchId()).get(0);
			mchinfo.setSwitchIndeMiniAppTime(null);//设置为空
			mchInfoWapper.updateByPrimaryKey(mchinfo);
			
			//公共小程序切换 成独立小程序
			shareTypeBbean.setMchId(ccbean.getMchId());
			shareTypeBbean.setMchShareType(5);//小程序（继承版）
			shareTypeBbean.setMchStatus(0);
			shareTypeBbean.setRemark("小程序 变为独立小程序（继承版）");
			shareTypeCall.setData(shareTypeBbean);
			shareTypeCall.callService();
			Thread.sleep(1000);
			detailmchbean.setMchId(ccbean.getMchId()); 
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			Logger.verifyIsNull( detailmchcall.getResult().getExpiredTime(), "验证ExpiredTime");
			Logger.verifyEquals(1, detailmchcall.getResult().getStatus(), "验证Status");
			checkVerify(ccbean.getMchId());
			
//			Logger.verifyEquals(ccbean.getMchId(),  Integer.parseInt(detailmchcall.getResult().getParentMchId()), "验证ParentMchId");
//			Logger.verifyEquals(shareTypeBbean.getMchShareType(),  detailmchcall.getResult().getmchShareType(), "验证mchShareType");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_016() {
		Logger.start(true,"商户信息,验证是双店模式,返回正常");
		try {
			String title="title1";
			String wc="wc2";
			CreateCodeBean ccbean = GodmchManageCallService.CreateAllMsgSellerMch();
//			String code = GodmchManageCallService.createCodeCall(ccbean).getCode();
//			Integer agentid = GodmchManageCallService.CreateSellerMch(code);
//			GodmchManageCallService.editMchInfo(ccbean.getMchId(),title, DGUserCallService.DefImg2,wc);
			 //设置双店模式
			setShareTypeBean setBean=GodmchManageCallService.initsetShareTypeV2(ccbean.getMchId());
			GodmchManageCallService.setShareTypeV2Call(setBean);
			
			detailmchbean.setMchId(ccbean.getMchId()); 
			//detailmchbean.setMchId(500093708); 
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			checkVerify(ccbean.getMchId());
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_017() {
		Logger.start(true,"商户信息,验证纯渠道设置盛付通 payChannel=2，返回正常");
		try {
            Integer mchId_channl = GodmchManageCallService.CreateSellerMch();
			
			setShareTypeBean setShareTypeBean=GodmchManageCallService.initsetShareTypeV2(mchId_channl);
			setShareTypeBean.setPayMode(3);//支付方式:微信支付通道1：飞界国际2：飞界国际电子商务3：盛付通 4:飞界国际贸易
			GodmchManageCallService.setShareTypeV2Call(setShareTypeBean);
			
			detailmchbean.setMchId(mchId_channl); 
			//detailmchbean.setMchId(500093708); 
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			checkVerify(mchId_channl);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_018() {
		Logger.start(true,"商户信息,验证商户id存在,独立商户,返回正常");
		try {
			
			createIndepMchBean createBean=GodmchManageCallService.InitCreateIndepMchBean();
			createIndepMchCall createCall=GodmchManageCallService.CreateIndepMchCall(createBean);
            
			detailmchbean.setMchId(createCall.getmchId()); 
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			checkVerify(createCall.getmchId(),true);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_019() {
		Logger.start(true,"商户信息,验证商户id存在,独立商户代理商,返回正常");
		try {

			createIndepMchBean createBean=GodmchManageCallService.InitCreateIndepMchBean();
			createIndepMchCall createCall=GodmchManageCallService.CreateIndepMchCall(createBean);
			applyAgentCall applyAgentCall=GodmchManageCallService.applyAndapproveAgent(createCall.getmchId());
			detailmchbean.setMchId(applyAgentCall.getAgentId()); 
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			
			checkVerify(applyAgentCall.getAgentId(),false);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_020() {
		Logger.start(true,"商户信息,验证商户id存在,独立商户供货商-返回正常");
		try {

			createIndepMchBean createBean=GodmchManageCallService.InitCreateIndepMchBean();
			createIndepMchCall createCall=GodmchManageCallService.CreateIndepMchCall(createBean);
			//申请供货商
			applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createCall.getmchId());
			com.ymatou.iapi.godmch.service.applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
			//审核供货商
			GodmchManageCallService.approveSupplier(applySupplierBean.getMchId(), applySupplierCall.getSupplierId());

			detailmchbean.setMchId(applySupplierCall.getSupplierId()); 
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			
			checkVerify(applySupplierCall.getSupplierId(),false);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_021() {
		Logger.start(true,"商户信息,验证商户id存在,微信HipoPay支付通道 payMode=0：不支持HipoPay");
		try {
			String title="title1";
			String wc="wc2";
			CreateCodeBean ccbean = GodmchManageCallService.CreateAllMsgSellerMch();
			String code = GodmchManageCallService.createCodeCall(ccbean).getCode();
			Integer agentid = GodmchManageCallService.CreateSellerMch(code);
			GodmchManageCallService.editMchInfo(ccbean.getMchId(),title, DGUserCallService.DefImg2,wc);
			
			//公共小程序切换 成独立小程序
			shareTypeBbean=GodmchManageCallService.initsetShareTypeV2(ccbean.getMchId());
			shareTypeBbean.setMchId(ccbean.getMchId());
			shareTypeBbean.setPayMode(0);//不支持HipoPay
			shareTypeCall.setData(shareTypeBbean);
			shareTypeCall.callService();
			
			detailmchbean.setMchId(ccbean.getMchId()); 
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();	
			
			checkVerify(ccbean.getMchId(),false);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_022() {
		Logger.start(true,"商户信息,验证商户id存在,微信国内支付通道 domesticPayMode=0：不支持 微信国内支付通道");
		try {
			String title="title1";
			String wc="wc2";
			CreateCodeBean ccbean = GodmchManageCallService.CreateAllMsgSellerMch();
			String code = GodmchManageCallService.createCodeCall(ccbean).getCode();
			Integer agentid = GodmchManageCallService.CreateSellerMch(code);
			GodmchManageCallService.editMchInfo(ccbean.getMchId(),title, DGUserCallService.DefImg2,wc);
			
			//公共小程序切换 成独立小程序
			shareTypeBbean=GodmchManageCallService.initsetShareTypeV2(ccbean.getMchId());
			shareTypeBbean.setMchId(ccbean.getMchId());
			shareTypeBbean.setDomesticPayMode(0);//不支持微信国内支付
			shareTypeCall.setData(shareTypeBbean);
			shareTypeCall.callService();
			
			detailmchbean.setMchId(ccbean.getMchId()); 
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();	
			
			checkVerify(ccbean.getMchId(),false);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_023() {
		Logger.start(true,"商户信息,验证商户id存在,微信国内支付通道 domesticPayMode=1：盛付通");
		try {
			String title="title1";
			String wc="wc2";
			CreateCodeBean ccbean = GodmchManageCallService.CreateAllMsgSellerMch();
			String code = GodmchManageCallService.createCodeCall(ccbean).getCode();
			Integer agentid = GodmchManageCallService.CreateSellerMch(code);
			GodmchManageCallService.editMchInfo(ccbean.getMchId(),title, DGUserCallService.DefImg2,wc);
			
			//公共小程序切换 成独立小程序
			shareTypeBbean=GodmchManageCallService.initsetShareTypeV2(ccbean.getMchId());
			shareTypeBbean.setMchId(ccbean.getMchId());
			shareTypeBbean.setDomesticPayMode(1);//盛付通
			shareTypeCall.setData(shareTypeBbean);
			shareTypeCall.callService();
			
			detailmchbean.setMchId(ccbean.getMchId()); 
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();	
			
			checkVerify(ccbean.getMchId(),false);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_024() {
		Logger.start(true,"商户信息,验证商户id存在,可以发布境内商品 pulishDomestic=true");
		try {
			String title="title1";
			String wc="wc2";
			CreateCodeBean ccbean = GodmchManageCallService.CreateAllMsgSellerMch();
			String code = GodmchManageCallService.createCodeCall(ccbean).getCode();
			Integer agentid = GodmchManageCallService.CreateSellerMch(code);
			GodmchManageCallService.editMchInfo(ccbean.getMchId(),title, DGUserCallService.DefImg2,wc);
			
			//公共小程序切换 成独立小程序
			shareTypeBbean=GodmchManageCallService.initsetShareTypeV2(ccbean.getMchId());
			shareTypeBbean.setMchId(ccbean.getMchId());
			shareTypeBbean.setPulishDomestic(true);//可以发布境内商品
			shareTypeCall.setData(shareTypeBbean);
			shareTypeCall.callService();
			
			detailmchbean.setMchId(ccbean.getMchId()); 
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			
			checkVerify(ccbean.getMchId(),false);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_025() {
		Logger.start(true,"商户信息,验证商户id存在,不可以发布境内商品 pulishDomestic=false");
		try {
			String title="title1";
			String wc="wc2";
			CreateCodeBean ccbean = GodmchManageCallService.CreateAllMsgSellerMch();
			String code = GodmchManageCallService.createCodeCall(ccbean).getCode();
			Integer agentid = GodmchManageCallService.CreateSellerMch(code);
			GodmchManageCallService.editMchInfo(ccbean.getMchId(),title, DGUserCallService.DefImg2,wc);
			
			//公共小程序切换 成独立小程序
			shareTypeBbean=GodmchManageCallService.initsetShareTypeV2(ccbean.getMchId());
			shareTypeBbean.setMchId(ccbean.getMchId());
			shareTypeBbean.setPulishDomestic(false);//不可以发布境内商品
			shareTypeCall.setData(shareTypeBbean);
			shareTypeCall.callService();
			
			detailmchbean.setMchId(ccbean.getMchId()); 
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();
			
			checkVerify(ccbean.getMchId(),false);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_026() {
		Logger.start(true,"商户信息,验证验证商户是为独立云特卖分销版商户,返回正常");
		try {
			
	        Integer mchId=sale_distribution;
	        detailmchbean.setMchId(mchId);
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();	
			
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			MchInfoVo return_info=detailmchcall.getResult();
			Logger.verifyEquals(return_info.getSaleDistribution(), true, "验证数据库mch_info中的saleDistribution与返回的是否一致");
			Logger.verifyEquals(return_info.getAgentPromote(), false, "验证数据库mch_info中的agentPromote与返回的是否一致");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_027() {
		Logger.start(true,"商户信息,验证验证商户是为代理裂变的代理商,返回正常(新增 20200821)");
		try {
            Integer mchId=agent_promote_mchId;
			//获取主商户agentType
			agent_typeWapper agentTypewapper = new agent_typeWapper();
			Map<String, Object> map = new HashMap();
			map.put("mchId", mchId);
			List<agent_type> agenttypeList = agentTypewapper.selectby(map);
			
			//申请 审核代理1
			applyAgentCall applyAgent =GodmchManageCallService.applyAndapproveAgent(mchId);
			editmchBean editmchBean=GodmchManageCallService.IniteditmachBean(applyAgent.getAgentId());
            GodmchManageCallService.editmachCall(editmchBean);
			
			getAgentPromotePicCall getAgentPromotePicCall=GodmchManageCallService.getAgentPromotePic(applyAgent.getAgentId());
			Thread.sleep(5000);
			registerByCodeBean registerBean=GodmchManageCallService.initRegisterByCode(mchId, getAgentPromotePicCall.getInviteCode());
			registerByCodeCall registerCall=GodmchManageCallService.registerByCodeCall(registerBean);
			Integer agentId2=registerCall.getRegMchId();
			Logger.comment("################ agentId2:"+agentId2);
			detailmchbean.setMchId(agentId2);
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();	
			
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			MchInfoVo return_info=detailmchcall.getResult();
			Logger.verifyEquals(return_info.getSaleDistribution(), false, "验证数据库mch_info中的saleDistribution与返回的是否一致");
			Logger.verifyEquals(return_info.getAgentPromote(), true, "验证数据库mch_info中的agentPromote与返回的是否一致");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_028() {
		Logger.start(true,"商户信息,验证商户id存在,返回正常(20200821)");
		try {
//			String title="title1";
//			String wc="wc2";
//			CreateCodeBean ccbean = GodmchManageCallService.CreateAllMsgSellerMch();
//			String code = GodmchManageCallService.createCodeCall(ccbean).getCode();
//			Integer agentid = GodmchManageCallService.CreateSellerMch(code);
//			GodmchManageCallService.editMchInfo(ccbean.getMchId(),title, DGUserCallService.DefImg2,wc);
//			detailmchbean.setMchId(ccbean.getMchId()); 
			detailmchbean.setMchId(501411612); 
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			//checkVerify(ccbean.getMchId());
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_detailmch_029() {
		Logger.start(true,"商户信息,验证商户id存在,masterChainShopId连锁店、wechatDirectPayMode微信直连,返回正常");
		try {
//			String title="title1";
//			String wc="wc2";
//			CreateCodeBean ccbean = GodmchManageCallService.CreateAllMsgSellerMch();
//			String code = GodmchManageCallService.createCodeCall(ccbean).getCode();
//			Integer agentid = GodmchManageCallService.CreateSellerMch(code);
//			GodmchManageCallService.editMchInfo(ccbean.getMchId(),title, DGUserCallService.DefImg2,wc);
//			detailmchbean.setMchId(ccbean.getMchId()); 
			detailmchbean.setMchId(masterChainShopId_wechatDirectPayMode); 
			detailmchcall.setData(detailmchbean);
			detailmchcall.callService();		
			Logger.verifyEquals("200", detailmchcall.getString("status"), "验证status");
			checkVerify(detailmchbean.getMchId());
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}